using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace ToolStripContainerProject
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            toolStripStatusLabel2.Text = "Logged as: " + SystemInformation.UserName;
            this.listView1.Columns.Add("Name", 200,
                HorizontalAlignment.Left);
            this.listView1.Columns.Add("Files", 80,
                HorizontalAlignment.Right);
            this.listView1.Columns.Add("Date", 100,
                HorizontalAlignment.Right);
            listView1.View = View.Details;
            this.toolStripContainer1.TopToolStripPanelVisible = false;
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            int i = 0;
            listView1.Items.Clear();
            DirectoryInfo dir = new
                DirectoryInfo(Convert.ToString( toolStripComboBox1.SelectedItem));

            ListViewItem item1;
            toolStripProgressBar1.Maximum
                = dir.GetFiles(toolStripTextBox1.Text).Length;
            foreach (FileInfo f in dir.GetFiles("*.*"))
            {
                item1 = new ListViewItem(f.Name);
                item1.SubItems.Add(
                    f.Length.ToString());
                item1.SubItems.Add(
                                    f .CreationTime.ToLongDateString ());
                listView1.Items.Add(item1);

                toolStripProgressBar1.Value = i;
                i++;

            }  
        }

      
    }
}